127

Shaping up

127

STEP 3 continued

    For i =​ 1 To k

      If k > 1 And msoAutoShapeTypeValue(i) +​ 0 =​ Worksheets(“ShapeList”).

Cells(kk, 1) Then

        FoundInstance =​ 1

        Worksheets(“ShapeList”).Cells(kk, 1) =​ msoAutoShapeTypeName(i)

        Exit For

      Else

        FoundInstance =​ 0

      End If

    Next

End Sub

8.3  CONCLUSION

In this chapter, instead of analyzing text to draw a graph, we analyzed a graph and

developed its description in text form. This is beneficial when the original text that

the graph was based upon is not available. This technique is also useful for data

analytics—​the text can be extended with other data points to develop intuitive con­

clusions about the scenario that the graph depicts. While there are many tools that

provide insightful analysis based on data, there are very few that can analyze graph­

ical inputs and provide textual inferences. Sometimes it is helpful even to count the

number of arrows in a diagram, because it helps to corelate and confirm the contents

of an intricate picture.

In this chapter you learned:

• Cataloguing shapes

• Recognizing types, names, and labels

• Working with groups

Here is a problem for you to work on your own.

Can you extend the code provided to count the number of rectangles, triangles, and

circles in the diagram? And can you classify them by color—​for example, three red

circles, two green rectangles, and so on?